using UnityEngine;
using System.Collections;

public class Calibrate : MonoBehaviour {
	
	public float w, h;
	public TextMesh tW, tH;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update ()
	{
		w = Camera.mainCamera.WorldToScreenPoint(collider.bounds.max).x - 
			Camera.mainCamera.WorldToScreenPoint(collider.bounds.min).x;
		tW.text = w.ToString() + " / " + Screen.width.ToString();
		tW.transform.position = new Vector3(transform.position.x, collider.bounds.max.y, transform.position.z - 1);
		
		h = Camera.mainCamera.WorldToScreenPoint(collider.bounds.max).y - 
			Camera.mainCamera.WorldToScreenPoint(collider.bounds.min).y;
		tH.text = h.ToString()  + " / " + Screen.height.ToString();
		tH.transform.position = new Vector3(collider.bounds.min.x, transform.position.y, transform.position.z - 1);
	}
}
